import mysql.connector
from mysql.connector import Error
import uuid
import random
from datetime import datetime, timedelta
from decimal import Decimal

def generate_order_time():
    """生成 2021-01-01 12:00:00 到 2025-12-12 12:00:00 之间的随机时间"""
    # 定义时间范围
    start_time = datetime(2021, 1, 1, 12, 0, 0)
    end_time = datetime(2025, 12, 12, 12, 0, 0)

    # 生成随机时间戳（精确到秒）
    random_seconds = random.randint(0, int((end_time - start_time).total_seconds()))
    return start_time + timedelta(seconds=random_seconds)


if __name__ =='__main__':
    order_time = generate_order_time()
    print(order_time)
    print(datetime.now())